home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: news.athene.co.uk!not-for-mail
- From: "C.J. Scaife" <JOLTSWIFT@Athene.co.uk>
- Subject: Re: extern consts
- Message-ID: <314D2BDF.1538@Athene.co.uk>
- Date: Mon, 18 Mar 1996 09:24:47 +0000
- References: <4idbcv$ue2@news7.erols.com> <314c2077.138956468@nntp.ix.netcom.com> <4ii7h9$bq6@news6.erols.com>
- Organization: JoltSwift Ltd.
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
- MIME-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
-
- Chris Cobb wrote:
- >
- > miker3@ix.netcom.com (Mike Rubenstein) wrote:
- > >
- > >It's not legal. extern const is legal, but in any compilation unit
- > >that does not see the initializer the const variable is not a constant
- > >expression.
- > >
- >
- > Well, your comment makes sense. However, in a way it seem
- > self-contradictory. If a const can be extern, then it no longer is a
- > const: you've basically externed away constness. But if thats what
- > externinig a const does, it doesn't make sense to allow it at all (which
- > is what happens on most compilers.)
- >
- > ChrisI disagree, const merely aims to prevent unintentional changes to the
- data, and there is no reason why it's value can't be held in an external
- module. afterall you might want to take the address of a constant, which
- you can't do with a #define!
-
-